package com.shixj.demo.Semaphore;

/**
 * Created by shixj on 2017/9/25.
 */
public class SetAdd implements Runnable {
    BoundedHashSet<Integer> set;
    private final int index;

    public SetAdd(BoundedHashSet<Integer> set, int index) {
        this.set = set;
        this.index = index;
    }

    @Override
    public void run() {
        try {
            set.add(index);
        }catch (InterruptedException e){
            e.printStackTrace();
        }
    }
}
